package com.diors.game.engine.network;

import com.diors.commons.network.DiorsBuffer;
import com.diors.commons.network.DiorsConnection;
import com.diors.commons.network.ReceivablePacket;

/**
 * 游戏连接
 * @author	darren.ouyang
 * @data	2013-9-10
 */
public class GameClient extends DiorsConnection 
{

	protected final ReceivablePacket createReceivableRacket (DiorsBuffer dbuffer)
	{
		return new GameClientPacket(this, dbuffer);
	}
	
	/**
	 * 发送数据包
	 * @param buffer
	 */
	public void sendPacket(DiorsBuffer buffer)
	{
		synchronized (guard)
		{
			if(isWrite())
				return;
			
			writeData(buffer);
		}
	}

	@Override
	public void connectionClose() 
	{
		
	}
	
}
